using System;
using System.Collections;
using Framework.Interop;

namespace Framework
{
    ///<summary>
    ///</summary>
    public class Column
    {
        private readonly bool _defaultVisible;
        private readonly ColumnFormat _format;
        private readonly Guid _formatID;
        private readonly string _name;
        private readonly int _propertyID;
        private readonly bool _slow;
        private readonly Type _type;
        private readonly int _width;

        ///<summary>
        ///</summary>
        ///<param name="name"></param>
        ///<param name="format"></param>
        ///<param name="width"></param>
        public Column(string name, ColumnFormat format, int width)
            : this(name, format, typeof (string), Guid.Empty, -1, width, true, false)
        {
        }

        ///<summary>
        ///</summary>
        ///<param name="name"></param>
        ///<param name="format"></param>
        ///<param name="type"></param>
        ///<param name="formatID"></param>
        ///<param name="propertyID"></param>
        ///<param name="width"></param>
        ///<param name="defaultVisible"></param>
        ///<param name="slow"></param>
        public Column(string name, ColumnFormat format, Type type, Guid formatID, int propertyID, int width,
                      bool defaultVisible, bool slow)
        {
            this._name = name;
            this._format = format;
            this._type = type;
            this._formatID = formatID;
            this._propertyID = propertyID;
            this._width = width;
            this._defaultVisible = defaultVisible;
            this._slow = slow;
        }

        ///<summary>
        ///</summary>
        public IComparer Comparer { get; set; }

        ///<summary>
        ///</summary>
        public ColumnFormat Format
        {
            get { return _format; }
        }

        ///<summary>
        ///</summary>
        public Guid FormatIdentifier
        {
            get { return _formatID; }
        }

        ///<summary>
        ///</summary>
        public int PropertyIdentifier
        {
            get { return _propertyID; }
        }

        ///<summary>
        ///</summary>
        public string Name
        {
            get { return _name; }
        }

        ///<summary>
        ///</summary>
        public bool DefaultVisible
        {
            get { return _defaultVisible; }
        }

        ///<summary>
        ///</summary>
        public bool Slow
        {
            get { return _slow; }
        }

        ///<summary>
        ///</summary>
        public Type Type
        {
            get { return _type; }
        }

        ///<summary>
        ///</summary>
        public int Width
        {
            get { return _width; }
        }
    } ;
}
